<?php
$this->breadcrumbs=array(
	'Productos',
);

$this->menu=array(
	array('label'=>'Crear producto', 'url'=>array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('tanai-product-master-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<h1>Administrar productos</h1>

<?php $this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'tanai-product-master-grid',
	'dataProvider'=>$model->search(),
	'filter'=>$model,
	'columns'=>array(
		'ref',
                array(
                    'name'=>'collection_sub',
                    'header'=>'Subcategoría',
                    'value'=>'TanaiProductMaster::getSubcategoryName($data->collection_sub)',
                ),
                array(
                    'name'=>'collection',
                    'header'=>'Categoría',
                    'value'=>'TanaiProductMaster::getCategoryName($data->collection)',
                ),
		array(
			'class'=>'CButtonColumn',
		),
	),
)); ?>
